#pragma once
#include "CoreMinimal.h"
#include "UnrealLua.h"
#include "BaseEngineLuaGlue.h"
#include "LuaEditorGlueMacro.h"
#include "SButton.h"
#include "SPanel.h"
#include "SDockTab.h"
#include "SBox.h"
#include "SCheckBox.h"
LUA_GLUE_ENUM_BEGIN(ESizeRule, FSizeParam::ESizeRule)
LUA_GLUE_ENUMKEY(SizeRule_Auto)
LUA_GLUE_ENUMKEY(SizeRule_Stretch)
LUA_GLUE_ENUM_END(ESizeRule)

LUA_GLUE_BEGIN(FSizeParam)
LUA_GLUE_PROPERTY(SizeRule)
LUA_GLUE_PROPERTY(Value)
LUA_GLUE_END()

LUA_GLUE_INTERFACE(FCoreStyle, FCoreStyle)
LUA_GLUE_FUNCTION(Get)
LUA_GLUE_END()

LUA_GLUE_BEGIN(FUICommandInfo)
LUA_GLUE_END()

LUA_GLUE_SHARED(FUICommandInfo, FUICommandInfo)
LUA_GLUE_SHARED(const_FUICommandInfo, const FUICommandInfo)

LUA_GLUE_ALIAS(FExecuteAction, FSimpleDelegate)
LUA_GLUE_ALIAS(FIsActionChecked, FIsActionChecked)
LUA_GLUE_DELEGATE(FGetActionCheckState, FGetActionCheckState)
LUA_GLUE_DELEGATE(FIsActionButtonVisible, FIsActionButtonVisible)


LUA_GLUE_ENUM_BEGIN(EUIActionRepeatMode, EUIActionRepeatMode)
LUA_GLUE_ENUMKEY(RepeatDisabled)
LUA_GLUE_ENUMKEY(RepeatEnabled)
LUA_GLUE_ENUM_END(EUIActionRepeatMode)

LUA_GLUE_BEGIN(FUIAction)
LUA_GLUE_END()

LUA_GLUE_BEGIN(FUICommandList)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, FCanExecuteAction CanExecuteAction, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, FCanExecuteAction CanExecuteAction, FIsActionChecked IsCheckedDelegate, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, FCanExecuteAction CanExecuteAction, FGetActionCheckState GetActionCheckState, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, FCanExecuteAction CanExecuteAction, FIsActionChecked IsCheckedDelegate, FIsActionButtonVisible IsVisibleDelegate, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, FExecuteAction ExecuteAction, FCanExecuteAction CanExecuteAction, FGetActionCheckState GetActionCheckState, FIsActionButtonVisible IsVisibleDelegate, EUIActionRepeatMode RepeatMode), EUIActionRepeatMode::RepeatDisabled)
LUA_GLUE_OVERLOAD(MapAction, void (FUICommandList::*)(const TSharedPtr< const FUICommandInfo > InUICommandInfo, const FUIAction& InUIAction))
LUA_GLUE_END()

LUA_GLUE_BEGIN(SPanel)
LUA_GLUE_FUNCTION(SetVisibility)
LUA_GLUE_END()

LUA_GLUE_ENUM_BEGIN(ETabRole, ETabRole)
LUA_GLUE_ENUMKEY(MajorTab)
LUA_GLUE_ENUMKEY(PanelTab)
LUA_GLUE_ENUMKEY(NomadTab)
LUA_GLUE_ENUMKEY(DocumentTab)
LUA_GLUE_ENUMKEY(NumRoles)
LUA_GLUE_ENUM_END(ETabRole)

LUA_SLATE_BEGIN(SDockTab)
	LUA_SLATE_DEFAULT_SLOT(FArguments, Content)
	LUA_SLATE_ATTRIBUTE(FMargin, ContentPadding)
	LUA_SLATE_ARGUMENT(ETabRole, TabRole)
	LUA_SLATE_ATTRIBUTE(FText, Label)
	LUA_SLATE_ATTRIBUTE(const FSlateBrush*, Icon)
	LUA_SLATE_EVENT(FOnTabClosedCallback, OnTabClosed)
	LUA_SLATE_EVENT(FOnTabActivatedCallback, OnTabActivated)
	LUA_SLATE_ARGUMENT(bool, ShouldAutosize)
	LUA_SLATE_EVENT(FCanCloseTab, OnCanCloseTab)
	LUA_SLATE_EVENT(FOnPersistVisualState, OnPersistVisualState)
	LUA_SLATE_ATTRIBUTE(FLinearColor, TabColorScale)
LUA_SLATE_BODY(SDockTab)
	LUA_GLUE_FUNCTION(SetContent)
LUA_SLATE_END()

LUA_SLATE_BEGIN(SBox)
	LUA_SLATE_ARGUMENT(EHorizontalAlignment, HAlign)
	LUA_SLATE_ARGUMENT(EVerticalAlignment, VAlign)
	LUA_SLATE_ATTRIBUTE(FMargin, Padding)
	LUA_SLATE_DEFAULT_SLOT(FArguments, Content)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, WidthOverride)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, HeightOverride)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, MinDesiredWidth)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, MinDesiredHeight)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, MaxDesiredWidth)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, MaxDesiredHeight)
	LUA_SLATE_ATTRIBUTE(FOptionalSize, MaxAspectRatio)
LUA_SLATE_BODY(SBox)
	LUA_GLUE_FUNCTION(SetContent)
	LUA_GLUE_FUNCTION(SetHAlign)
	LUA_GLUE_FUNCTION(SetVAlign)
	LUA_GLUE_FUNCTION(SetPadding)
	LUA_GLUE_FUNCTION(SetWidthOverride)
	LUA_GLUE_FUNCTION(SetHeightOverride)
	LUA_GLUE_FUNCTION(SetMinDesiredWidth)
	LUA_GLUE_FUNCTION(SetMinDesiredHeight)
	LUA_GLUE_FUNCTION(SetMaxDesiredWidth)
	LUA_GLUE_FUNCTION(SetMaxDesiredHeight)
	LUA_GLUE_FUNCTION(SetMaxAspectRatio)
LUA_SLATE_END(SPanel)

LUA_GLUE_BEGIN(SCompoundWidget)
LUA_GLUE_FUNCTION(GetContentScale)
LUA_GLUE_FUNCTION(SetContentScale)
LUA_GLUE_FUNCTION(GetColorAndOpacity)
LUA_GLUE_FUNCTION(SetColorAndOpacity)
LUA_GLUE_FUNCTION(SetForegroundColor)
LUA_GLUE_FUNCTION(SetVisibility)
LUA_GLUE_END(SWidget)

LUA_SLATE_BEGIN(SBorder)
	LUA_SLATE_DEFAULT_SLOT(FArguments, Content)
	LUA_SLATE_ARGUMENT(EHorizontalAlignment, HAlign)
	LUA_SLATE_ARGUMENT(EVerticalAlignment, VAlign)
	LUA_SLATE_ATTRIBUTE(FMargin, Padding)
	LUA_SLATE_EVENT_RAW(FPointerEventHandler, OnMouseButtonDown)
	LUA_SLATE_EVENT_RAW(FPointerEventHandler, OnMouseButtonUp)
	LUA_SLATE_EVENT_RAW(FPointerEventHandler, OnMouseMove)
	LUA_SLATE_EVENT_RAW(FPointerEventHandler, OnMouseDoubleClick)
	LUA_SLATE_ATTRIBUTE(const FSlateBrush*, BorderImage)
	LUA_SLATE_ATTRIBUTE(FVector2D, ContentScale)
	LUA_SLATE_ATTRIBUTE(FVector2D, DesiredSizeScale)
	LUA_SLATE_ATTRIBUTE(FLinearColor, ColorAndOpacity)
	LUA_SLATE_ATTRIBUTE(FSlateColor, BorderBackgroundColor)
	LUA_SLATE_ATTRIBUTE(FSlateColor, ForegroundColor)
	LUA_SLATE_ATTRIBUTE(bool, ShowEffectWhenDisabled)
LUA_SLATE_BODY(SBorder)
LUA_SLATE_END(SCompoundWidget)

LUA_SLATE_BEGIN(SButton)
	LUA_SLATE_DEFAULT_SLOT(FArguments, Content)
	LUA_SLATE_STYLE_ARGUMENT(FButtonStyle, ButtonStyle)
	LUA_SLATE_STYLE_ARGUMENT(FTextBlockStyle, TextStyle)
	LUA_SLATE_ARGUMENT(EHorizontalAlignment, HAlign)
	LUA_SLATE_ARGUMENT(EVerticalAlignment, VAlign)
	LUA_SLATE_ATTRIBUTE(FMargin, ContentPadding)
	LUA_SLATE_ATTRIBUTE(FText, Text)
	LUA_SLATE_EVENT_RAW(FOnClicked, OnClicked)
	LUA_SLATE_EVENT_RAW(FSimpleDelegate, OnPressed)
	LUA_SLATE_EVENT_RAW(FSimpleDelegate, OnReleased)
	LUA_SLATE_EVENT_RAW(FSimpleDelegate, OnHovered)
	LUA_SLATE_EVENT_RAW(FSimpleDelegate, OnUnhovered)
	LUA_SLATE_ARGUMENT(EButtonClickMethod::Type, ClickMethod)
	LUA_SLATE_ARGUMENT(EButtonTouchMethod::Type, TouchMethod)
	LUA_SLATE_ARGUMENT(EButtonPressMethod::Type, PressMethod)
	LUA_SLATE_ATTRIBUTE(FVector2D, DesiredSizeScale)
	LUA_SLATE_ATTRIBUTE(FVector2D, ContentScale)
	LUA_SLATE_ATTRIBUTE(FSlateColor, ButtonColorAndOpacity)
	LUA_SLATE_ATTRIBUTE(FSlateColor, ForegroundColor)
	LUA_SLATE_ARGUMENT(bool, IsFocusable)
	LUA_SLATE_ARGUMENT(TOptional<FSlateSound>, PressedSoundOverride)
	LUA_SLATE_ARGUMENT(TOptional<FSlateSound>, HoveredSoundOverride)
	LUA_SLATE_ARGUMENT(TOptional<ETextShapingMethod>, TextShapingMethod)
	LUA_SLATE_ARGUMENT(TOptional<ETextFlowDirection>, TextFlowDirection)
LUA_SLATE_BODY(SButton)
LUA_SLATE_END(SBorder)

LUA_SLATE_BEGIN(STextBlock)
	LUA_SLATE_ATTRIBUTE(FText, Text)
	LUA_SLATE_STYLE_ARGUMENT(FTextBlockStyle, TextStyle)
	LUA_SLATE_ATTRIBUTE(FSlateFontInfo, Font)
	LUA_SLATE_ATTRIBUTE(FSlateColor, ColorAndOpacity)
	LUA_SLATE_ATTRIBUTE(FVector2D, ShadowOffset)
	LUA_SLATE_ATTRIBUTE(FLinearColor, ShadowColorAndOpacity)
	LUA_SLATE_ATTRIBUTE(FLinearColor, HighlightColor)
	LUA_SLATE_ATTRIBUTE(const FSlateBrush*, HighlightShape)
	LUA_SLATE_ATTRIBUTE(FText, HighlightText)
	LUA_SLATE_ATTRIBUTE(float, WrapTextAt)
	LUA_SLATE_ATTRIBUTE(bool, AutoWrapText)
	LUA_SLATE_ATTRIBUTE(ETextWrappingPolicy, WrappingPolicy)
	LUA_SLATE_ATTRIBUTE(FMargin, Margin)
	LUA_SLATE_ATTRIBUTE(float, LineHeightPercentage)
	LUA_SLATE_ATTRIBUTE(ETextJustify::Type, Justification)
	LUA_SLATE_ATTRIBUTE(float, MinDesiredWidth)
	LUA_SLATE_ARGUMENT(TOptional<ETextShapingMethod>, TextShapingMethod)
	LUA_SLATE_ARGUMENT(TOptional<ETextFlowDirection>, TextFlowDirection)
	LUA_SLATE_EVENT_RAW(FOnClicked, OnDoubleClicked)
LUA_SLATE_BODY(STextBlock)
	LUA_GLUE_FUNCTION(GetText)
	LUA_GLUE_OVERLOAD(SetText, void (STextBlock::*)(const TAttribute<FText>&))
	LUA_GLUE_FUNCTION(SetHighlightText)
	LUA_GLUE_FUNCTION(SetFont)
	LUA_GLUE_FUNCTION(SetColorAndOpacity)
	LUA_GLUE_FUNCTION(SetTextStyle)
	LUA_GLUE_FUNCTION(SetTextShapingMethod)
	LUA_GLUE_FUNCTION(SetTextFlowDirection)
	LUA_GLUE_FUNCTION(SetWrapTextAt)
	LUA_GLUE_FUNCTION(SetAutoWrapText)
	LUA_GLUE_FUNCTION(SetWrappingPolicy)
	LUA_GLUE_FUNCTION(SetShadowOffset)
	LUA_GLUE_FUNCTION(SetShadowColorAndOpacity)
	LUA_GLUE_FUNCTION(SetMinDesiredWidth)
	LUA_GLUE_FUNCTION(SetLineHeightPercentage)
	LUA_GLUE_FUNCTION(SetMargin)
	LUA_GLUE_FUNCTION(SetJustification)
LUA_SLATE_END()

LUA_GLUE_BEGIN(SBoxPanel)
LUA_GLUE_FUNCTION(RemoveSlot)
LUA_GLUE_FUNCTION(ClearChildren)
LUA_GLUE_END(SPanel)

LUA_GLUE_BEGIN(FSlotBase)
LUA_GLUE_FUNCTION(AttachWidgetParent)
LUA_GLUE_FUNCTION(AttachWidget)
LUA_GLUE_FUNCTION(GetWidget)
LUA_GLUE_FUNCTION(DetachWidget)
LUA_GLUE_END()

LUA_GLUE_BEGIN_NAME(SBoxPanel_FSlot, SBoxPanel::FSlot)
LUA_GLUE_PROPERTY(HAlignment)
LUA_GLUE_PROPERTY(VAlignment)
LUA_GLUE_PROPERTY(SizeParam)
LUA_GLUE_PROPERTY(SlotPadding)
LUA_GLUE_PROPERTY(MaxSize)
LUA_GLUE_END(FSlotBase)

LUA_SLATE_SLOT_BEGIN(SVerticalBox, FSlot)
	LUA_GLUE_FUNCTION(AutoHeight)
	LUA_GLUE_FUNCTION(MaxHeight)
	LUA_GLUE_FUNCTION(FillHeight)
	LUA_GLUE_FUNCTION(HAlign)
	LUA_GLUE_FUNCTION(VAlign)
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float, float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float, float, float, float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(const TAttribute<FMargin>::FGetter&))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(TAttribute<FMargin>))
LUA_SLATE_ARGS_BEGIN(SVerticalBox)
	LUA_SLATE_SUPPORTS_SLOT(SVerticalBox::FSlot)
LUA_SLATE_ARGS_END(SVerticalBox, SBoxPanel::FSlot)
	LUA_GLUE_FUNCTION(AddSlot)
	LUA_GLUE_FUNCTION(InsertSlot, INDEX_NONE)
	LUA_GLUE_FUNCTION(NumSlots)
LUA_SLATE_SLOT_END(SBoxPanel)

LUA_SLATE_SLOT_BEGIN(SHorizontalBox, FSlot)
	LUA_GLUE_FUNCTION(AutoWidth)
	LUA_GLUE_FUNCTION(MaxWidth)
	LUA_GLUE_FUNCTION(FillWidth)
	LUA_GLUE_FUNCTION(HAlign)
	LUA_GLUE_FUNCTION(VAlign)
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float, float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(float, float, float, float))
	LUA_GLUE_OVERLOAD(Padding, TheClassType& (TheClassType::*)(TAttribute<FMargin>))
LUA_SLATE_ARGS_BEGIN(SHorizontalBox)
	LUA_SLATE_SUPPORTS_SLOT(SHorizontalBox::FSlot)
LUA_SLATE_ARGS_END(SHorizontalBox, SHorizontalBox::FSlot)
	LUA_GLUE_FUNCTION(AddSlot)
	LUA_GLUE_FUNCTION(InsertSlot, INDEX_NONE)
	LUA_GLUE_FUNCTION(NumSlots)
LUA_SLATE_SLOT_END(SBoxPanel)

LUA_SLATE_BEGIN(SCheckBox)
	LUA_SLATE_DEFAULT_SLOT(FArguments, Content)
	LUA_SLATE_STYLE_ARGUMENT(FCheckBoxStyle, Style)
	LUA_SLATE_ARGUMENT(TOptional<ESlateCheckBoxType::Type>, Type)
	LUA_SLATE_EVENT_RAW(FOnCheckStateChanged, OnCheckStateChanged)
	LUA_SLATE_ATTRIBUTE(ECheckBoxState, IsChecked)
	LUA_SLATE_ARGUMENT(EHorizontalAlignment, HAlign)
	LUA_SLATE_ATTRIBUTE(FMargin, Padding)
	LUA_SLATE_ATTRIBUTE(EButtonClickMethod::Type, ClickMethod)
	LUA_SLATE_ATTRIBUTE(FSlateColor, ForegroundColor)
	LUA_SLATE_ATTRIBUTE(FSlateColor, BorderBackgroundColor)
	LUA_SLATE_ARGUMENT(bool, IsFocusable)
	LUA_SLATE_EVENT_RAW(FOnGetContent, OnGetMenuContent)
	LUA_SLATE_ARGUMENT(TOptional<FSlateSound>, CheckedSoundOverride)
	LUA_SLATE_ARGUMENT(TOptional<FSlateSound>, UncheckedSoundOverride)
	LUA_SLATE_ARGUMENT(TOptional<FSlateSound>, HoveredSoundOverride)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UncheckedImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UncheckedHoveredImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UncheckedPressedImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, CheckedImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, CheckedHoveredImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, CheckedPressedImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UndeterminedImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UndeterminedHoveredImage)
	LUA_SLATE_ARGUMENT(const FSlateBrush*, UndeterminedPressedImage)
LUA_SLATE_BODY(SCheckBox)
LUA_SLATE_END()